<include file="../Public/plugin.header.html" />

<link href="__PUBLIC__/Css/plugin-gift.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2&services=true"></script>
<script type="text/javascript" src="__PUBLIC__/Js/kim.base.map.js"></script>
<php>
$_REQUEST['goPageFun']="goPageBSub";//设定分页调用函数
if(empty($bsub_brandid))$bsub_brandid	= $productdata['partner_id'];	//商户id	
$bsub_area_id	= $_REQUEST['area_id'];	//区域id	
$bsub_city_id	= $_REQUEST['city_id'];	//城市id
$bsub_bsubpage 	= service('Brand')->search4UserBSub($bsub_brandid,$bsub_area_id,$bsub_city_id,null,20);
</php>
<div id="store_json_data" class="hidden">
		<php>
		if(count($bsub_bsubpage['data'])>0){
			echo json_encode( format2MapData($bsub_bsubpage['data']) );
		}
		</php>
</div>
<script type="text/javascript" charset="utf-8">
	//class="top_bar top_baron" class="top_bar"  k_changeGroupStylek_changeGroupStyle('list_top',' ul > li','detail','top_bar_on');
 	$(document).ready(function(){
 		resizeFull();
 		window.onload=resizeFull;
 		window.onresize=resizeFull;
 		
 		var list_top_rel  = 'detail';
 		<php>if(empty($productdata['goods_detail'])){</php>
 			list_top_rel  = 'place';
		<php>}</php>
 		k_changeGroupStyle('list_top',' ul > li',list_top_rel,'top_bar_on');
 		<php>if($productdata['goods_get_type']!='delivery'){</php>
 			initMap("map-box","39.925","116.385",11);
 			cleanAll();
			var store_infos = eval('( ' + $('#store_json_data').html() + ' )');
			store_markers = drawStoreMarkers(store_infos,marker_icon);
		
			//在地图上显示第一个店的信息框
			<php>if(count($bsub_bsubpage['data'])>0){</php>
			var _ttmp_marker = getStoreMarker( "{$bsub_bsubpage['data'][0].id}" );
			if(_ttmp_marker!=null){
				var _infoWindow = getStoreInfoWindow(new BMap.Size(0, _ttmp_marker.marker.getIcon().size.height*(-1) ),_ttmp_marker.storeinfo);
				_ttmp_marker.marker.openInfoWindow(_infoWindow);
			}
			<php>}</php>
		<php>}</php>
 	});
</script>

<div id="g_plugin_main">
<!--页面主部-->
<div class="p_main" id="p_main">

	<div class="blank10"></div>
	<!--主体左部，为商品详情页-->
	<div class="primary_box" id="topbar">
		<!--商品概要信息展示，最右上侧-->
		<ul class="info">
			<php>//dump($productdata);</php>
			<!--1. 商品名称-->
			<li class="name"><strong>{$productdata['goods_title']}</strong>
			&nbsp;<a title="点击查看该店所有商品" href="{:U('plugin://gift/store',array('bid'=>$productdata['partner_id']))}" class="info_a">
							（{$productdata['partner_title']}）</a>
			</li>
			<li></li>
			<!--4. 小心意价格-->
			<li>心 意&nbsp;&nbsp;价： <span class="sell">{:formatMoney($productdata['shelf_out_price'])}</span>
					&nbsp;&nbsp;（市 价： <b class="price">{:formatMoney($productdata['shelf_market_price'])}</b>）
			</li>
			<li>兑换方式： <span>{$productdata['goods_get_type']|getGoodsGetTypeDesc}</span>
			&nbsp;&nbsp;&nbsp;&nbsp;已送出&nbsp; <span style="color: #D30200;font-size: 16px;">{$productdata['shelf_send_number']+$productdata['shelf_default_number']}</span>&nbsp;份
			</li>
			<php>if($productdata['goods_get_type']=='self'){</php>
			<li>兑换地点：
				<a title="查看{:K('SP_COUPON_NM')}能够兑换的所有连锁店地址" href="#goods_place" onclick="k_changeGroupStyle('list_top',' ul > li','place','top_bar_on');
						$('#goods_place').show();$('#goods_spxq').hide();$('#goods_sysm').show();$('#goods_fwcn').show();" class="info_a">查看地点</a></li>
			<php>}</php>
			<php>if($productdata['goods_get_type']=='delivery'){</php>
				<li>兑换地点： 收礼者拨打商家电话（{$productdata['partner_phone']},{$productdata['partner_mobile']}）告知快递地址</li>
			<php>}</php>
			<php>if($productdata['goods_get_type']=='all'){</php>
				<li>兑换地点： 收礼者拨打商家电话（{$productdata['partner_phone']},{$productdata['partner_mobile']}）告知快递地址或到店面进行兑换（<a title="查看{:K('SP_COUPON_NM')}能够兑换的所有连锁店地址" href="#goods_place" onclick="k_changeGroupStyle('list_top',' ul > li','place','top_bar_on');
						$('#goods_place').show();$('#goods_spxq').hide();$('#goods_sysm').show();$('#goods_fwcn').show();" class="info_a">查看地点）</li>
			
			<php>}</php>
			<li>券有效期： <span style="font-size:14px;font-weight:bold;color: #333333;">{:exchangeTimeDesc($productdata['shelf_exchange_time'])}</span></li>
			
			<!-- 画一条横线 -->
			<li class="br_line clear"></li>
		</ul>

		<!--商品图片展示，最左上侧-->
		<div class="pic">
			<!--1. 图片盒，目前共四张，用js来控制显示与否-->
			<div id="pic_box">
				<div style="float: left;">
					<a 	href="#"  class="goods_b"
						title="{$productdata['goods_title']}" >
						<php>if($productdata['goods_get_type']=='delivery'||$productdata['goods_get_type']=='all'){</php>
							<em class="peisong"><img src="__PUBLIC__/Images/global/icon_peisong_1.gif"></em>
						<php>}</php>
						<img src="{:getPhotoFromThumb($productdata['goods_icon'],300,300)}" alt="{$productdata['goods_title']}">	
					</a>
				</div>
			</div>
		</div>
		<div class="clear"></div>
		<div class="blank5"></div>
		<div style="width:100%">
			<div class="left" style="width:140px;text-align:center;padding-top: 25px;">
				<php>if($checkresult['isCanOn']){</php>
				<a href="{:U('plugin://order/orderEdit',array('shelfid'=>$productdata['shelf_id']))}">
					<img  border="0" src="__PUBLIC__/Images/plugin/btn_givegift_X135.jpg" alt="发送礼物给朋友">
				</a>
				<!--  
				<br>
				<a href="javascript:void(0);" 
					callback="javascript:k_docollection({ shelf_id : '{$productdata['shelf_id']}' ,stype : '{:Dict::DESIROUS}' },function(){ });"
					onclick="sendHeEmail(this,'你的姓名');">
					<img border="0" 
						src="__PUBLIC__/Images/plugin/btn_askgift_X135.jpg" alt="找他/她帮忙买礼物">
				</a>
				-->
				<php>}else{</php>
					<font style="font-size:20px;color: #D30200; font-weight: bold;">{$checkresult['desc']}</font>
				<php>}</php>
			</div>
			<div style="float:right;width:360px">
				<div class="blank5"></div>
				<!--5. 使用说明-->
				<div class="details" >
					<div class="details_top_short">心意券说明</div>
					<include file="../Product/Tpl/default/Public/goods_sysm_box.html" />
			        <div class="blank10"></div>
				</div>
			</div>
		</div>
		
	</div>

	<!--详情下面的商品详情、评论、购买咨询以及服务承诺-->
	<div class="primary_box" style="overflow:hidden;">
		<!--1. Tab页栏-->
		<div id="list_top" class="list_top">
			<ul >
				<php>if(!empty($productdata['goods_detail'])){</php>
				<li class="top_bar top_bar_on" rel="detail" 
					onclick="k_changeGroupStyle('list_top',' ul > li','detail','top_bar_on');
							$('#goods_spxq').show();$('#goods_place').show();$('#goods_sysm').show();$('#goods_fwcn').show();
							">商品详情</li>
				<php>}</php>
				
				<li class="top_bar top_bar_on" rel="place"
					onclick="k_changeGroupStyle('list_top',' ul > li','place','top_bar_on');
							$('#goods_place').show();$('#goods_spxq').hide();$('#goods_sysm').show();$('#goods_fwcn').show();
							">兑换地点</li>
	
				<li class="top_bar" rel="service"
					onclick="k_changeGroupStyle('list_top',' ul > li','service','top_bar_on');
							$('#goods_fwcn').show();$('#goods_spxq').hide();$('#goods_sysm').hide();$('#goods_place').hide();
							">服务承诺</li>
			</ul>
		</div>
		
		<div style="width:510px">
			<php>if($productdata["partner_explain"] || ($productdata['goods_get_type']=='delivery'||$productdata['goods_get_type']=='all') ){</php>
			<div class="details">
				<div class="details_top">注意事项</div>
				<dl style="padding:2px 0px;color: #CC0000;" class="intro_pay">
					<dd>
						<php>if(($productdata['goods_get_type']=='delivery'||$productdata['goods_get_type']=='all') ){</php>
						<p>此礼品无需到店自取！心意券中将写明兑换确认电话。收礼人拨打店家兑换电话，店家验证后发货。</p>
						<php>}</php>
						<php>if($productdata["partner_explain"]){</php>
							{$productdata["partner_explain"]}
						<php>}</php>
					</dd>
				</dl>
		   	</div>
			<php>}</php>
		
			<php>if(!empty($productdata['goods_detail'])){</php>
			<!--2. 商品详情-->
			<div class="details" id="goods_spxq">
				{$productdata['goods_detail']}
			</div>
			<php>}</php>
			<!--5. 使用说明-->
			<div class="details" id="goods_place">
				<div class="details_top">兑换地点</div>
				<php>if($productdata['goods_get_type']=='self'){</php>
					<span style="line-height:25px;">到如下店面进行兑换：</span>
					<div id="map-box" style="width:508px;" ></div>
				<php>}</php>
				<php>if($productdata['goods_get_type']=='delivery'){</php>
					<span style="line-height:25px;">拨打商家电话（{$productdata['partner_phone']},{$productdata['partner_mobile']}）告知快递地址。</span>
				<php>}</php>
				<php>if($productdata['goods_get_type']=='all'){</php>
					<span style="line-height:25px;">拨打商家电话（{$productdata['partner_phone']},{$productdata['partner_mobile']}）告知快递地址或到如下店面进行兑换：</span>
					<div id="map-box"  style="width:508px;"></div>
				<php>}</php>
		        <div class="blank10"></div>
		        <div class="blank10"></div>
		        <div class="blank10"></div>
			</div>
			
			<!--5. 服务承诺-->
			<div class="details" id="goods_fwcn">
				<div class="details_top">服务承诺</div>
				<include file="../Product/Tpl/default/Public/goods_fwcn_box.html" />
				<div class="blank10"></div>
		        <div class="blank10"></div>
		        <div class="blank10"></div>
			</div>
		</div>
	</div>
	<div class="clear"></div>

</div>
</div>

<include file="../Public/plugin.footer.html" />